package com.data.modules.online.cgform.converter.p009a;

import java.util.List;
import java.util.Map;

import com.data.common.system.vo.DictModel;
import com.data.common.util.ConvertUtils;
import com.data.modules.online.cgform.converter.FieldCommentConverter;

public class ForeseeConvert implements FieldCommentConverter {

    protected String f122a;

    protected List<DictModel> f123b;

    public String getFiled() {
        return this.f122a;
    }

    public void setFiled(String filed) {
        this.f122a = filed;
    }

    public List<DictModel> getDictList() {
        return this.f123b;
    }

    public void setDictList(List<DictModel> dictList) {
        this.f123b = dictList;
    }

    @Override
    public String converterToVal(String txt) {
        if (ConvertUtils.isNotEmpty(txt)) {
            for (DictModel dictModel : this.f123b) {
                if (dictModel.getText().equals(txt)) {
                    return dictModel.getValue();
                }
            }
        }
        return null;
    }

    @Override
    public String converterToTxt(String val) {
        if (ConvertUtils.isNotEmpty(val)) {
            for (DictModel dictModel : this.f123b) {
                if (dictModel.getValue().equals(val)) {
                    return dictModel.getText();
                }
            }
        }
        return null;
    }

    @Override
    public Map<String, String> getConfig() {
        return null;
    }
}
